quiz1_scores = {'Alice': 8, 'Bob': 9, 'Charlie': 7, 'David': 10}
quiz2_scores = {'Alice': 9, 'Bob': 8, 'Eve': 9, 'David': 9}
both_high_scores_students = []
for student in quiz1_scores.keys():
    if student in quiz2_scores and quiz1_scores[student] >= 9 and quiz2_scores[student] >= 9:
        both_high_scores_students.append(student)
print(f"在两次测验中都获得9分或以上的学生姓名: {both_high_scores_students}")